package com.ssy.lingxi.product.entity.platform;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * 属性组实体类--平台后台
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/23
 */
@Getter
@Setter
@Entity
@Table(schema = "public", name = "product_attribute_group", indexes = {@Index(name = "product_customer_attribute_group_name_idx", columnList = "name")})
public class AttributeGroup implements Serializable {
    private static final long serialVersionUID = -1647177580717190192L;
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="attribute_group_seq")
    @SequenceGenerator(sequenceName="product_attribute_group_seq", name="attribute_group_seq",allocationSize = 1)
    private Long id;

    /**
     * 属性组名
     */
    @NotEmpty(message = "属性组名不能为空")
    @Column(columnDefinition = "varchar(20)", nullable = false)
    private String name;

}
